翻訳と辞書
Words near each other
・ Charruba
・ Charruba–Timimi Road
・ Charruodon
・ Charrúa Gap
・ Charrúa language
・ Charrúa people
・ Charrúa Ridge
・ Chars
・ Charsadda
・ Charsadda (disambiguation)
・ Charsadda District
・ Charsadda District, Afghanistan
・ Charsadda District, Pakistan
・ Charsadda railway station
・ Charsadda Tehsil
Charset detection
・ Charsfield
・ Charsh Darreh
・ Charshanga
・ Charsianon
・ Charsk
・ Charsley's Hall
・ Charsonville
・ Charsoo Awantipora
・ Charszewo
・ Charsznica
・ Chart
・ Chart (disambiguation)
・ Chart datum
・ Chart Hills Golf Club


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Charset detection : ウィキペディア英語版
Charset detection
Character encoding detection, charset detection, or code page detection is the process of heuristically guessing the character encoding of a series of bytes that represent text. The technique is recognised to be unreliable and is only used when specific metadata, such as a HTTP Content-Type: header is either not available, or is assumed to be untrustworthy.
This algorithm usually involves statistical analysis of byte patterns, like frequency distribution of trigraphs of various languages encoded in each code page that will be detected; such statistical analysis can also be used to perform language detection. This process is not foolproof because it depends on statistical data.
One of the few cases where charset detection works reliably is detecting UTF-8. This is due to the large percentage of invalid byte sequences in UTF-8, so that text in any other encoding that uses bytes with the high bit set is ''extremely'' unlikely to pass a UTF-8 validity test. Unfortunately, badly written charset detection routines do not run the reliable UTF-8 test first, and may decide that UTF-8 is some other encoding.
UTF-16 is fairly reliable to detect due to the high number of newlines (U+000A) and spaces (U+0020) that should be found when dividing the data into 16-bit words. This process is not foolproof; for example, some versions of the Windows operating system would mis-detect the phrase "Bush hid the facts" (without a newline) in ASCII as Chinese UTF-16LE.
Charset detection is particularly unreliable in Europe, in an environment of mixed ISO-8859 encodings. These are closely related eight-bit encodings that share an overlap in their lower half with ASCII. There is no technical way to tell these encodings apart and recognising them relies on identifying language features, such as letter frequencies or spellings.
Due to the unreliability of heuristic detection, it is better to properly label datasets with the correct encoding. HTML documents served across the web by HTTP should have their encoding stated out-of-band using the Content-Type: header.
Content-Type: text/html;charset=UTF-8
An isolated HTML document, such as one being edited as a file on disk, may imply such a header by a meta tag within the file:



or with a new meta type in HTML5



If the document is Unicode, then some UTF encodings explicitly label the document with an embedded initial byte order mark (BOM).
== See also ==

* International Components for Unicode - A library that can perform charset detection.
* Language identification
* Browser sniffing, a similar heuristic technique for determining the capabilities of a web browser, before serving content to it.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Charset detection」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.